
cmake_minimum_required(VERSION 3.5.1)

project(qtnotify LANGUAGES CXX VERSION 0.0.1)

include(cmake/SparkEnvConfig.cmake)
include(cmake/SparkMacrosConfig.cmake)
include(cmake/SparkFindLibraries.cmake)
include(cmake/SparkFindQt5Config.cmake)
# include(cmake/SparkFindQt6Config.cmake)
include(cmake/SparkInstallMacrosConfig.cmake)

# 资源文件路径
set(QRC_SOURCES "res.qrc")

spark_add_library_path(qnotify
    src/widgets
)
target_link_qt5(qnotify)

spark_add_executable_path(${PROJECT_NAME} src
    ${QRC_SOURCES}
)
target_link_qnotify(${PROJECT_NAME})

# 安装头文件与与库目标文件 
spark_install_directory(include/qnotify
    src/widgets/*
)
spark_install_target(lib
    qnotify
)
# 用于 cmake find_package 的查找库
spark_install_file(lib/cmake/QNotify
    cmake/QNotifyConfig.cmake
)
# qnotify 默认的资源文件
spark_install_file(share/qnotify/assets
    ./assets/message.png
)
spark_install_file(share/qnotify
    ./res.qrc
)

include(cmake/SparkBuildGraphviz.cmake)